package com.itheima.demo3;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicintegerTest extends Thread{
    private AtomicInteger count;

    AtomicintegerTest(){
        count = new AtomicInteger();
    }

    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.println(Thread.currentThread().getName()+"送了"+count.incrementAndGet()+"个冰淇淋");
        }
    }
}
